<?php

namespace app\common\service\deploy;

use app\admin\model\deploy\PayDeploy;
use app\common\service\BaseService;
use think\facade\Cache;

class RechargeList extends BaseService
{
    /**
     * Author:Yingbo Sun
     * 充值金额列表
     * @throws \Psr\SimpleCache\InvalidArgumentException
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public static function rechargeList()
    {
        $redis = Cache::store('redis');
        $redis->select(12);
        $bool = $redis->has("rechargeList");
        if ($bool){
            $data = $redis->get('rechargeList');
        }else{
            $data = PayDeploy::select();
            $data && $data = $data->toArray();
            $redis->set('rechargeList',$data);
        }
        return self::success('获取成功',$data);
    }
}